public class TV extends Colleague{
    public TV(String name, Mediator mediator) {
        super(name, mediator);
        mediator.resister(name,this);
    }

    public void SendTV(int stateChange){
        sendMessage(stateChange);
    }

    @Override
    public void sendMessage(int stateChange) {
        this.getMediator().getMessage(stateChange,this.getName());
    }

    public void openTV(){
        System.out.println("电视正在打开---------");
    }

    public void closeTV(){
        System.out.println("电视正在关闭---------");
    }
}
